// 存储历史记录
import { openDB } from 'idb';

const DB_NAME = 'ChatHistoryDB';
export const STORE_NAME = 'conversations';
const DB_VERSION = 1;

export const dbPromise = openDB(DB_NAME, DB_VERSION, {
  upgrade(db) {
    db.createObjectStore(STORE_NAME, { keyPath: 'character.name' });
  },
});